package com.dailyblue.java.project.bookstore.pubinfo.controller;

import com.dailyblue.java.project.bookstore.pubinfo.service.PubInfoService;
import com.dailyblue.java.project.bookstore.pubinfo.util.JsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/pub")
public class PubInfoController {
    @Resource
    private PubInfoService pubInfoService;

    @GetMapping("/{id}")
    public JsonResult findById(@PathVariable("id") int id) {
        return pubInfoService.findPubInfoById(id);
    }
}
